print("********fuck world********")
# 单行注释

'''
多行注释
多行注释
多行注释
'''
"""
多行注释
多行注释
多行注释
"""

# a=5
# if a>10:
#     pass
# else:
#     print(a)

# name= input("name:")
# add= input("add:")
# age=int(input("age:"))
# hobby=input("hobby:")
# s="name is %s,add is %s,age is &d,hobby is %s".format(name ,add ,age, hobby)
# s1="name is {},add is {},age is {},hobby is {}".format(name ,add ,age, hobby)
# s2=f"name is {name}add is {add},age is {add},hobby is {hobby},hobby is {hobby},hobby is {hobby}"
# print(s)
# print(s1)
# print(s2)

# lst = ['赵敏','张绍刚' ,'赵本山','张无忌','武则天','赢政','马超']
# for item in lst:
#     if item.startswith("张"):
#         new_name="王"+item[1:]
#         print(new_name)

# lst = ['赵敏','张绍刚' ,'赵本山','张无忌','武则天','赢政','马超']
# for i in range(len(lst)):
#     item=lst[i]
#     if item.startswith("张"):
#         new_name="王"+item[1:]
#         print(new_name)
#         lst[i]=new_name
# print(lst)


dic={
    "zhaosi":"123",
    "zhangsan":"456",
    "wangwu":"789"
}
# # 1. 遍历字典的键
# for key in dic:
#      print(key)
# # 2. 遍历字典的键和对应的值
# for key in dic:
#      print(key,dic[key])
# # 3. 获取字典的键
# print(dic.keys())
# # 4. 将字典的键转换为列表
# print(list(dic.keys()))
# # 5. 获取字典的值
# print(dic.values())
# # 6. 将字典的值转换为列表
# print(list(dic.values()))



# 遍历字典的键和值，以元组形式输出
# for item in dic.items():
#     print(item)

# 遍历字典的键和值，并分别打印出来
# for item in dic.items():
#     key=item[0]
#     value=item[1]
#     print(key,value)

# 解构赋值，将元组中的元素分别赋值给不同的变量
# a,b=1,2
# print(a)
# print(b)
# a,b=(3,4)
# print(a)
# print(b)

# 使用元组拆包的方式直接获取键和值
# for item in dic.items():
#     key,value=item
#     print(key,value)

# 最简洁，最Pythonic的方式，可以直接拿到所有的key和value(*****)
# for key,value in dic.items():
#     print(key,value)

# s="周杰伦"
# # 编码
# bs1=s.encode("gbk")
# bs2=s.encode("utf-8")
# print(bs1)
# print(bs2)
# # 解码
# bs=b'\xd6\xdc\xbd\xdc\xc2\xd7'
# s=bs.decode("gbk")
# print(s)
# # 转码
# bs2=s.encode("utf-8")
# print(bs2)

# f=open("葫芦娃.txt", mode="r", encoding="utf-8")

# content=f.read()
# print(content)

# line=f.readline()
# print(line)
# line=f.readline()
# print(line)
# line=f.readline()
# print(line)
# line=f.readline()
# print(line)

# print(f.readline().strip())
# print(f.readline().strip())
# print(f.readline().strip())
# print(f.readline().strip())

# content=f.readlines()
# print(content)

# lst={"zzz",'xxx',"ccc"}
#
# f=open("./testfile/葫芦娃.txt",mode="w",encoding="utf-8")
#
# for item in lst:
#     f.write(item)
#     f.write("\n")
#
# f.close()





# f=open("./testfile/葫芦娃.txt",mode="a",encoding="utf-8")
# f.write("你好厉害")

# with open("./testfile/葫芦娃.txt",mode="r",encoding="utf-8") as f:
#     for line in f:
#         print(line.strip())
#

# with open("./testfile/壁纸.jpg",mode="rb") as f1,\
# open("./testfile/壁纸2.jpg",mode="wb") as f2:
#         for line in f1:
#             f2.write(line)


# with open("./testfile/葫芦娃.txt",mode="r",encoding="utf-8") as f1,\
# open("./testfile/葫芦娃2.txt",mode="w",encoding="utf-8") as f2:
#         for line in f1:
#             line=line.strip()   # 将f1每一行的内容去掉前后空格(空格中包括了后面的换行符)写入到line
#             if line.startswith("xxx"):
#                 line=line.replace("xxx","123")
#
#             f2.write(line)
#             f2.write("\n")



# lst=["zzz",'xxx',"ccc","zzz",'xxx',"ccc","zzz",'xxx',"ccc","zzz",'xxx',"ccc"]
#
# with open("./testfile/葫芦娃.txt",mode="w",encoding="utf-8") as f:
#     for item in lst:
#         f.write(item)
#         f.write("\n")

#
# import os
# import time
# with open("testfile/葫芦娃.txt", mode="r", encoding="utf-8") as f1,\
#      open("testfile/葫芦娃2.txt", mode="w", encoding="utf-8") as f2:
#         for line in f1:
#             line=line.strip()   # 将f1每一行的内容去掉前后空格(空格中包括了后面的换行符)写入到line
#             if line.startswith("xxx"):
#                 line=line.replace("xxx","123")
#
#             f2.write(line)
#             f2.write("\n")
# time.sleep(1)
# os.remove("testfile/葫芦娃.txt")
# time.sleep(1)
# os.rename("testfile/葫芦娃2.txt", "testfile/葫芦娃.txt")

# def luru(name,age,gender="男"):
#     print(name,age,gender)
#
# luru("zhangsan",18)
# luru("lisi",18)
# luru("wangwu",18,"男")
# luru("liuming",18,"女")

# def luru(name,age=20,gender):
#     print(name,age,gender)
# # ps：python规则，默认值参数必须放在非默认值参数的后面，否则报错
# luru("zhangsan",18,"男")
# luru("lisi",18,"男")
# luru("wangwu",18,"男")
# luru("liuming",18,"女")

# def eat(zhushi,fushi,tang,tianpin):
#     print(zhushi,fushi,tang,tianpin)
#
# eat("rice","eags","nori soup","icecream")
# eat(zhushi="rice",tianpin="icecream",fushi="eags",tang="nori soup")
# eat("rice","eags",tang="nori soup",tianpin="icecream")

#
# def eat(*food):
#     print(food)
#
# eat("rice","eags","nori soup","icecream")
# eat("icecream")
# eat("rice","eags")

# def eat(**food):
#     print(food)
#
# eat(zhushi="rice",fushi="eags")

# def func(a,b,c="haha",*args,**kwargs):
#     print(a,b,c,args,kwargs)
#
# func(1,2,3,4,5,6,hello=456,hahalou=654)

# def func(a,b,*args,c="haha",**kwargs):
#     print(a,b,c,args,kwargs)
#
# func(1,2,3,4,5,6,c="hehe",hello=456,hahalou=654)

# 输出所有ASCII码对应的字符。
# 其中chr函数将十进制整数转换为对应的 ASCII 字符，
# print函数中的end=""参数表示输出时不要加上默认的换行符。
# for i in range(65536):
#     print(chr(i)+" ",end="")


# lst=["zhangsan","lisi","wangwu","liuli"]
# # enumerate可以在遍历一个列表时同时获得它的索引和元素值
# # item 表示遍历到的当前元素，它的形式是一个元组 (index, value)
# for item in enumerate(lst):
#     print(item)
# # 解包，使用 index 和 item 分别表示当前元素的索引和值。
# for index,item in enumerate(lst):
#     print(index,item)
# # 效果同上
# for i in range(len(lst)):
#     print(i,lst[i])

#
# print(help(str))
# print(dir(str))

# def func1():
#     print(123)
#     def func2():
#         print(456)
#         def func3():
#             print(789)
#         print(1)
#         func3()
#         print(2)
#     print(3)
#     func2()
#     print(4)
# func1()

#
# def an():
#     print(123)
# an()
# bn=an
# bn()

# a=20
#
# def func():
#     global a
#     a=10
#     print(a)
# func()
# print(a)

#
# def func1():
#     a=10
#     def func2():
#         # nonlocal a
#         a=20
#     func2()
#     print(a)
#
# func1()
#
